package com.cqc.topbarbaseactivitydemo;

import android.os.Bundle;

public class MainActivity extends TopBarBaseActivity {//AppCompatActivity

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//                setContentView(R.layout.activity_main);
    }

    @Override
    public int getContentView() {
        return R.layout.activity_main;
    }

    @Override
    protected void initViews(Bundle savedInstanceState) {
        setTitle("Title");
        setTopBarLeftButton(R.mipmap.back, new OnClickListener() {
            @Override
            public void onClick() {
                ToastUtil.showShortToast(context, "点击了左侧图标");
            }
        });

        setTopBarRightButton("右边", new OnClickListener() {
            @Override
            public void onClick() {
                ToastUtil.showShortToast(context, "点击了右侧图标");
            }
        });

        setTopBarRightButton("定位", R.mipmap.location, new OnClickListener() {
            @Override
            public void onClick() {
                ToastUtil.showShortToast(context, "点击了定位");
            }
        });
    }
}
